package day01;

import java.util.Arrays;
import java.util.Scanner;

public class DiGui {
    public static void main(String[] args) {
        System.out.println("输入一个正整数");
        int n = new Scanner(System.in).nextInt();
        DiGui d = new DiGui();
        System.out.println("阶乘为："+d.f(n));
        System.out.println("斐波那契数列第"+n+"位:"+d.fb(n));
        int a[] =new int[n];
        for (int i = 1; i <=n; i++) {

            a[i-1]= d.fb(i);
        }
        System.out.println(Arrays.toString(a));
    }
//    阶乘
    long f(int num ){
        if (num==1){
            return 1;
        }else
            return num*f(num-1);
    }
//    斐波那契数列
    int fb(int num ){
        if (num==1||num==2){
            return 1;
        }else {
            return fb(num-1)+fb(num-2);
        }
    }
}
